// ==UserScript==
// @name         mideazn-label Extend
// @namespace    http://tampermonkey.net/
// @version      1.0.0
// @description  mideazn-label 扩展程序
// @author       Timeic
// @license      MIT
// @run-at       document-body
// @match        *://hz.mideazn.com/study_manage/wrongcollect*
// @require      https://cdn.timeic.top/extendWebPage-dep-global-1.0.0.js
// @require      https://cdn.timeic.top/extendWebPage.js
// ==/UserScript==

(function (global) {
    const routeWrongCollect = {
        routes: '*://hz.mideazn.com/study_manage/wrongcollect*',
        style: `.prev-btn {position: fixed;top: 0px;right: 420px;cursor: pointer;background: #61a187;border-radius: 10px;padding: 22px 10px;color: #fff} .next-con {position: fixed;top: 0px;left: 0px;right: 0px;margin: auto;text-align: center;z-index: 9999;background: #0088ff6b}`,
        extend: {
            prevBtn: $(`<div class="prev-btn" onclick="$('.answer-box .answer-result .result-box.active').prev().click()">Prev</div>`)
        },
        loadExec() {
            $(document.body).append(this.prevBtn)
            $(document).on('keydown', e => {
                if (e.code === 'KeyQ')
                    $('.answer-box .answer-result .result-box.active').click()
                else if (e.code === 'KeyE')
                    $('.handleBox .handleBtn.active').click()
                else if (e.code === 'Space')
                    $('.handleBox .handleBtn.active').click()
            })
        }

    }

    global.extendApp = extendWebPage([routeWrongCollect])
})(window)